//引入mongoose
const mongoose = require('mongoose');
//2.设置需要连接的数据库地址student-examination-system
const dbURL = 'mongodb://localhost:27017/student-examination-system';
//3.连接数据库
mongoose.connect(dbURL, { useNewUrlParser: true, useUnifiedTopology: true });
//4.设置连接成功的提示
mongoose.connection.on('connected', () => console.log(dbURL + '数据库连接成功'));
